package com.yz.newspaper.controller;


import com.yz.newspaper.pojo.po.UserScore;
import com.yz.newspaper.pojo.result.Result;
import com.yz.newspaper.pojo.unitPo.PageBean;
import com.yz.newspaper.service.IUserScoreService;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * 用户每月分数记录
 *
 * @author author
 * @since 2024-05-02
 */
@RestController
@RequestMapping("/user-score")
@Slf4j
public class UserScoreController {
    @Autowired
    private IUserScoreService userScoreService;

    @ApiOperation("用户每月分数记录")
    @GetMapping("/list")
    public Result getUserScore(String username, String mediaName, Integer year, Integer month, Integer pageNum, Integer pageSize) {
        log.info("用户每月分数记录");
        log.info("username:{},mediaName:{},year:{},month:{},pageNum:{},pageSize:{}", username, mediaName, year, month, pageNum, pageSize);
        PageBean pageBean = userScoreService.getUserScore(username, mediaName, year, month, pageNum, pageSize);
        return Result.success(pageBean);
    }

}
